package com.wyl.idempotentcheck.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wyl.idempotentcheck.common.R;
import com.wyl.idempotentcheck.entity.User;
import com.wyl.idempotentcheck.mapper.UserMapper;
import com.wyl.idempotentcheck.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IUserService {

    @Autowired
    private UserMapper userMapper;


    @Override
    public User selectById(Long id) {
        return userMapper.selectById(id);
    }

    @Override
    public void saveUser(User user) {
        userMapper.insert(user);
    }

    @Override
    public R updateUserById(User user) {
        userMapper.updateById(user);
        return R.success(user);
    }


}
